<div data-extend-template="layouts/partials/table.html">
  <span data-block="no-rows-message" translate>
    No tasks exist for this resource.
  </span>

  <div data-block="search">
    <input type="text" class="form-control" placeholder="{{ 'Filter' | translate }}" ng-model="taskFilter" />
  </div>

  <div data-block="table">
    <table bst-table="table" ng-class="{'table-mask': table.working}" class="table table-striped table-bordered">
      <thead>
        <tr bst-table-head>
          <th bst-table-column="Status"><span translate>Status</span></th>
          <th bst-table-column="Event"><span translate>Event</span></th>
          <th bst-table-column="User"><span translate>User</span></th>
          <th bst-table-column="Date"><span translate>Date</span></th>
        </tr>
      </thead>

      <tbody>
        <tr bst-table-row ng-repeat="task in table.rows | filter:taskFilter">
          <td bst-table-cell>
            <div ng-class="{ active: (task.state === 'pending' || task.state === 'running') }" class="progress progress-striped">
              <span uib-progressbar animate="false" value="task.progressbar.value" type="{{task.progressbar.type}}"></span>
            </div>
          </td>
          <td bst-table-cell>
            <a class="active" ng-click="table.gotoDetails(task.id)">
              {{ task.humanized.action }}
              {{ task.humanized.input | taskInputReduce:knownContext | taskInputCompile }}
            </a>
          </td>
          <td bst-table-cell>{{ task.username }}</td>
          <td bst-table-cell><short-date-time date="task.started_at" /></td>
        </tr>
      </tbody>
    </table>
  </div>
</div>
